package megadrum.gui;

import megadrum.Common;

public class CustomSpinnerNoteModel extends CustomSpinnerIntModel {

    public CustomSpinnerNoteModel() {
        super();
    }

    public CustomSpinnerNoteModel(int value, int minimum, int maximum, int stepSize) {
        super(value, minimum, maximum, stepSize);
    }

    @Override
    public Object getValue() {
        int note = (Integer) value.intValue();
        if (note == 0) {
            return "Disabled";
        } else {
            return Common.NOTENAMES_SCALE[note % Common.NOTENAMES_SCALE.length] +
                    " " +
                    (int) (Math.floor((double) note / (double) Common.NOTENAMES_SCALE.length) + Common.FIRST_SCALE) +
                    " (" + note + ")";
        }
    }
}
